class CreateComments < ActiveRecord::Migration
  def self.up
    create_table :comments do |t|
      t.column(:resource_id, :integer)
      t.column(:resource_type, :string)
      t.column(:name,:string)
      t.column(:email,:string)
      t.column(:content,:text)
      t.column(:created_at,:datetime)
    end
    #execute "alter table comments add constraint fk_comments_photos foreign key(photo_id) references photos(id)"
  end

  def self.down
    drop_table :comments
  end
end
